import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
export default new Router({
    routes: [{
            path: '/',
            redirect: '/welcom'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: {
                title: '自述文件'
            },
            children: [{
                    path: '/order',
                    component: resolve => require(['../components/page/Order.vue'], resolve),
                    meta: {
                        title: '预约中心'
                    }
                },
                {
                    path: '/welcom',
                    component: resolve => require(['../components/page/Welcom.vue'], resolve),
                    meta: {
                        title: '欢迎页'
                    }
                },
                {
                    path: '/imageupload',
                    component: resolve => require(['../components/page/ImageUpload.vue'], resolve),
                    meta: {
                        title: '落地页'
                    }
                },
                {
                    path: '/articleList',
                    component: resolve => require(['../components/page/articleList.vue'], resolve),
                    meta: {
                        title: '文章列表'
                    }
                },
                {
                    path: '/banner',
                    component: resolve => require(['../components/page/Banner.vue'], resolve),
                    meta: {
                        title: 'Banner设置'
                    }
                },
                {
                    // 推广人员管理
                    path: '/people',
                    component: resolve => require(['../components/page/SpreadPeople.vue'], resolve),
                    meta: {
                        title: '人员管理'
                    }
                },
                {
                    // 推广设置区域统计
                    path: '/spreadarea',
                    component: resolve => require(['../components/page/SpreadArea.vue'], resolve),
                    meta: {
                        title: '推广区域',
                        permission: true
                    }
                },
                {
                    // 推广设置区域统计
                    path: '/spread',
                    component: resolve => require(['../components/page/Spread.vue'], resolve),
                    meta: {
                        title: '推广设置',
                        permission: true
                    }
                },
                {
                    // 异常统计
                    path: '/errorexcel',
                    component: resolve => require(['../components/page/ErrorExcel.vue'], resolve),
                    meta: {
                        title: '异常统计'
                    }
                },
                {
                    // 咨询详情
                    path: 'extendDetail',
                    name: 'extendDetail',
                    component: resolve => require(['../components/page/ExtendDetail.vue'], resolve),
                    meta: {
                        title: '咨询详情',
                        permission: true
                    }
                },
                {
                    path: '/extend',
                    component: resolve => require(['../components/page/Extend.vue'], resolve),
                    meta: {
                        title: '小组管理'
                    }
                },
                {
                    path: '/groupmember',
                    component: resolve => require(['../components/page/Member.vue'], resolve),
                    meta: {
                        title: '组员管理'
                    },
                    // children: [
                    //     {
                    //         // 咨询详情
                    //         path: 'extendDetail',
                    //         name: 'extendDetail',
                    //         component: resolve => require(['../components/page/ExtendDetail.vue'], resolve),
                    //         meta: { title: '咨询详情', permission: true }
                    //     }
                    // ]
                },
                {
                    path: '/customer',
                    name: 'customer',
                    component: resolve => require(['../components/page/Customer.vue'], resolve),
                    meta: {
                        title: '客户管理'
                    }
                },
                {
                    path: '/paymentOrder',
                    component: resolve => require(['../components/page/paymentOrder.vue'], resolve),
                    meta: {
                        title: '流水'
                    }
                },
                {
                    path: '/role',
                    component: resolve => require(['../components/page/Role.vue'], resolve),
                    meta: {
                        title: '角色权限'
                    }
                },
                {
                    path: '/pageSet',
                    component: resolve => require(['../components/page/PageSet.vue'], resolve),
                    meta: {
                        title: '菜单权限'
                    }
                },
                {
                    path: '/checkCoupon',
                    component: resolve => require(['../components/page/checkCoupon.vue'], resolve),
                    meta: {
                        title: '验券'
                    }
                },
                {
                    path: '/accountAccess',
                    component: resolve => require(['../components/page/AccountAccess.vue'], resolve),
                    meta: {
                        title: '员工管理'
                    }
                },
                {
                    path: '/table',
                    component: resolve => require(['../components/page/BaseTable.vue'], resolve),
                    meta: {
                        title: '基础表格'
                    }
                },
                {
                    path: '/tabs',
                    component: resolve => require(['../components/page/Tabs.vue'], resolve),
                    meta: {
                        title: 'tab选项卡'
                    }
                },
                {
                    path: '/form',
                    component: resolve => require(['../components/page/BaseForm.vue'], resolve),
                    meta: {
                        title: '基本表单'
                    }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: resolve => require(['../components/page/VueEditor.vue'], resolve),
                    meta: {
                        title: '富文本编辑器'
                    }
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: resolve => require(['../components/page/Markdown.vue'], resolve),
                    meta: {
                        title: 'markdown编辑器'
                    }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: resolve => require(['../components/page/Upload.vue'], resolve),
                    meta: {
                        title: '文件上传'
                    }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: resolve => require(['../components/page/BaseCharts.vue'], resolve),
                    meta: {
                        title: 'schart图表'
                    }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: resolve => require(['../components/page/DragList.vue'], resolve),
                    meta: {
                        title: '拖拽列表'
                    }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: resolve => require(['../components/page/Permission.vue'], resolve),
                    meta: {
                        title: '权限测试',
                        permission: true
                    }
                },
                {
                    // 修改密码
                    path: '/changePW',
                    component: resolve => require(['../components/page/changePW.vue'], resolve),
                    meta: {
                        title: '修改密码',
                        permission: true
                    }
                },
                {
                    // 修改密码
                    path: '/changeName',
                    component: resolve => require(['../components/page/changeName.vue'], resolve),
                    meta: {
                        title: '修改昵称',
                        permission: true
                    }
                }
            ]
        },
        {
            path: '/setting',
            name: 'setting',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            children: [{
                    // 会员搜索
                    path: '/member',
                    component: resolve => require(['../components/setting/member.vue'], resolve),
                    meta: {
                        title: '会员',
                        permission: true
                    }
                },
                {
                    // 会员详情
                    path: '/memberDetails',
                    component: resolve => require(['../components/setting/memberDetails.vue'], resolve),
                    meta: {
                        title: '会员详情',
                        permission: true
                    }
                },
                {
                    // 门店
                    path: '/store',
                    component: resolve => require(['../components/setting/store.vue'], resolve),
                    meta: {
                        title: '门店管理',
                        permission: true
                    }
                },
                {
                    // 券
                    path: '/voucher',
                    component: resolve => require(['../components/setting/voucher.vue'], resolve),
                    meta: {
                        title: '电子券管理',
                        permission: true
                    }
                },
                {
                    // 服务项目
                    path: '/server',
                    component: resolve => require(['../components/setting/server.vue'], resolve),
                    meta: {
                        title: '服务项目',
                        permission: true
                    }
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
        {
            path: '/403',
            component: resolve => require(['../components/page/403.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
